//https://leetcode-cn.com/problems/ransom-note/

class Solution {
public:
    bool canConstruct(string ransomNote, string magazine) {
        int cnt[128] = {0};
        for (int i = 0; magazine[i]; i++) cnt[magazine[i]]  += 1;
        for (itn i = 0; ransomNote[i]; i++) {
            cnt[ransomNote[i]] -= 1;
            if (cnt[ransomNote[i]] == -1) return false;
        }
        return true;
    }
};